#ifndef DISK_H_
#define DISK_H_

#include "Renderable.h"

class Disk : public Renderable
{
public:
    Disk() : m_rad(0.0f) {}
    Disk(const Vec3& pos, float radius, const Vec3& norm, 
        const Material& m, bool reflect,float reflectance) : Renderable(m,reflect,reflectance),
        m_pos(pos), m_rad(radius), m_normal(norm){m_normal.normalise();}

    virtual bool Hit(const Ray& ray, float& tmin, ContactData& data) const;

    void SetPosition(float x, float y, float z){m_pos.SetStats(x,y,z);}
    void SetRadius(float rad){m_rad = rad;}
    void SetNormal(float x, float y, float z){m_normal.SetStats(x,y,z);m_normal.normalise();}
    virtual void CalculateBox()
    {
        m_hasValidBox = true;
        m_box.CreateFromPosAndHalf(m_pos, Vec3(m_rad,m_rad,m_rad));
#ifdef DEBUGGING
        m_information += "Class:  Disk \n";
#endif
    }
private:
    Vec3 m_pos;
    Vec3 m_normal;
    float m_rad;
};
#endif